//
//  RMMUpOrederGoodsTableViewCell.m
//  Romomo
//
//  Created by puman on 16/10/11.
//  Copyright © 2016年 mazegong. All rights reserved.
//

#import "RMMUpOrederGoodsTableViewCell.h"

@implementation RMMUpOrederGoodsTableViewCell
{
    UIImageView *_imageV;
    UILabel *_titleLabel;
    UILabel *_priceLabel;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _imageV = [[UIImageView alloc] initWithFrame:CGRectMake(15, 7, 40, 40)];
        _imageV.layer.masksToBounds = YES;
        _imageV.layer.cornerRadius = 5;
        [self.contentView addSubview:_imageV];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(_imageV.right + 12, 0, kScreenWideth - 85 - 12 - _imageV.right, 54)];
        _titleLabel.numberOfLines = 0;
        _titleLabel.textColor = COLORFROMCODE(0x000000, 1);
        _titleLabel.font = kFont(14);
        [self.contentView addSubview:_titleLabel];
        
        _priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWideth - 85, 0, 70, 54)];
        _priceLabel.numberOfLines = 0;
        _priceLabel.textAlignment = NSTextAlignmentRight;
        _priceLabel.textColor = COLORFROMCODE(0x9B9B9B, 1);
        _priceLabel.font = kFont(14);
        [self.contentView addSubview:_priceLabel];
        
        _imageV.image = [UIImage imageNamed:@"加载中@3x"];
    }
    return self;
}
- (void)setModel:(RMMShopingModel *)model{
     [_imageV sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kBaseImageUrl,[RMMFileManager retrunObjWith:model.IMAGEURL]]] placeholderImage:[UIImage imageNamed:@"加载中@3x"]];
    _titleLabel.text = [NSString stringWithFormat:@"%@x%@",model.SERVICE_NAME,model.COUNT];
    NSInteger count = [model.COUNT integerValue];
    CGFloat price = [model.PRICE floatValue];
    _priceLabel.text = [NSString stringWithFormat:@"¥%.2f",count *price];

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
